import { createRouter, createWebHistory } from "vue-router";

const routes = [
  {
    path: "/",
    component: () => import("@/views/mainLayout/indexView.vue"),
    children: [
      {
        path: "/",
        component: () => import("@/views/home/indexView.vue"),
      },
      {
        path: "/classify",
        component: () => import("@/views/classify/indexView.vue"),
      },
      {
        path: "/cart",
        component: () => import("@/views/cart/indexView.vue"),
      },
      {
        path: "/my",
        component: () => import("@/views/my/indexView.vue"),
      },
    ],
  },
  {
    path: "/detail",
    component: () => import("@/views/detail/indexView.vue"),
  },
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

export default router;
